Virtual machines are abstract computers that allow for portability of software, typically for running virtual applications between different underlying computer architectures. A virtual machine (VM) is a complex software product that is implemented upon a particular computer hardware platform and/or operating system. The VM then provides a uniform layer of abstraction between the hardware platform and any compiled software applications that will run thereon. Virtual machines are considered essential for the portability of certain technologies, such as Java. The Java Virtual Machine (JVM) allows compiled Java programs to be run on the JVM, independently of whatever hardware or operating system may be used underneath. Examples of available JVMs include the Sun Java Virtual Machine from Sun Microsystems, Inc., and the JRockit Virtual Machine from BEA Systems, Inc.
A real CPU understands and executes instructions native to that CPU (commonly called native code). In comparison, a virtual machine understands and executes virtual machine instructions (commonly called bytecode).
A virtual machine such as the JRockit Virtual Machine from BEA Systems, Inc. compiles the bytecode into native machine code tailored for the particular OS/CPU combination on which JRockit is running. It does so using compiler optimization techniques. Examples of such compiler techniques are described in “Advanced Compiler Design and Implementation” by Steven S. Muchnik; “Crafting a Compiler with C” by Charles N. Fischer and Richard J. LeBlanc, Jr.; and “Compilers” by Alfred V. Aho, Ravi Sethi, Jeffrey D. Ullman, each of which are incorporated herein by reference.
One feature that is commonly used to increase performance in a VM and in pointer free languages such as Java is the array copy operation, in which an array can be optimized by allocating a new larger array, and copying the contents into the new array. However, array copying is a time expensive operation on modern hardware with its memory bandwidth limitations. This is the area the present invention is designed to address.